package com.project.entity.user;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToOne;

import com.project.entity.BaseEntity;
import com.project.entity.sys.Area;

@MappedSuperclass
public abstract class BaseUser extends BaseEntity{

	private static final long serialVersionUID = 8362084397191942686L;

	@Column(name="user_code")
	private String userCode;//账号
	
	@Column
	private String name;//名称

	@Column
	private String mobile;//手机
	
	@Column
	private String email;//电子邮箱
	
	@Column
	private String company;//公司
	
	@Column
	private String position;//职位
	
	@Column(name="adept_field")
	private String adeptField;//擅长领域
	
	@Column
	private String province;//省
	
	@Column
	private String city;//市
	
	@Column
	private String district;//区
	
	@Column
	private String address;//地址
	
	@Column
	private String intro;//简介
	
	@Column
	private String honor;//荣誉
	
	@Column
	private String writings;//著作
	
	@Column(name="update_user")
	private String updateUser;//修改人
	
	@Column(name="update_time")
	private Date updateTime;//修改时间
	
	@OneToOne(fetch=FetchType.LAZY,cascade=CascadeType.REFRESH)
    @JoinColumn(name="province",referencedColumnName="code",updatable=false,insertable=false)
    private Area provinceEntity;
    
    @OneToOne(fetch=FetchType.LAZY,cascade=CascadeType.REFRESH)
    @JoinColumn(name="city",referencedColumnName="code",updatable=false,insertable=false)
    private Area cityEntity;
    
    @OneToOne(fetch=FetchType.LAZY,cascade=CascadeType.REFRESH)
    @JoinColumn(name="district",referencedColumnName="code",updatable=false,insertable=false)
    private Area districtEntity;
    
    
    /**
     * @return Returns the provinceEntity.
     */
    public Area getProvinceEntity() {
        return provinceEntity;
    }

    /**
     * @param provinceEntity The provinceEntity to set.
     */
    public void setProvinceEntity(Area provinceEntity) {
        this.provinceEntity = provinceEntity;
    }

    /**
     * @return Returns the cityEntity.
     */
    public Area getCityEntity() {
        return cityEntity;
    }

    /**
     * @param cityEntity The cityEntity to set.
     */
    public void setCityEntity(Area cityEntity) {
        this.cityEntity = cityEntity;
    }

    /**
     * @return Returns the districtEntity.
     */
    public Area getDistrictEntity() {
        return districtEntity;
    }

    /**
     * @param districtEntity The districtEntity to set.
     */
    public void setDistrictEntity(Area districtEntity) {
        this.districtEntity = districtEntity;
    }

	public String getUserCode() {
		return userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public String getAdeptField() {
		return adeptField;
	}

	public void setAdeptField(String adeptField) {
		this.adeptField = adeptField;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getDistrict() {
		return district;
	}

	public void setDistrict(String district) {
		this.district = district;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}

	public String getHonor() {
		return honor;
	}

	public void setHonor(String honor) {
		this.honor = honor;
	}

	public String getWritings() {
		return writings;
	}

	public void setWritings(String writings) {
		this.writings = writings;
	}

	public String getUpdateUser() {
		return updateUser;
	}

	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
}
